import React, { Component } from 'react';
class child extends Component {
  state={}
  update=()=>{
    this.props.amendPrice(10)
  }
  render(){
    return(<>
      <h2>子组件</h2>
      <p>价格:{this.props.price}</p>
      <button onClick={this.update}>修改价格</button>
    </>)
  }
}
export default child